/**
 * Copyright &copy; 2012-2014 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.schedul.entity;

import java.util.Date;

import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.thinkgem.jeesite.common.persistence.DataEntity;
import com.thinkgem.jeesite.common.utils.excel.annotation.ExcelField;
import com.thinkgem.jeesite.modules.sys.entity.Office;

/**
 * 考勤时段表Entity
 * @author pan.zhou
 * @version 2017-07-15
 */
public class Schclass extends DataEntity<Schclass> {
	
	private static final long serialVersionUID = 1L;
	private String schname;		// 时段名称
	private Date starttime;		// 上班时间
	private Date endtime;		// 下班时间
	private Date checkintime1;		// 开始签到时间点
	private Date checkintime2;		// 结束签到时间点
	private Date checkouttime1;		// 开始签退时间点
	private Date checkouttime2;		// 结束签退时间点
	private Date startresttime;		// 开始休息时间
	private Date endresttime;		// 结束休息时间
	private String shiftworktime;		// 工作时间(分钟)
	private String isovertime;		// 延时是否计算加班
	private Office company; // 归属公司
	private Office office;  // 归属部门
	
	private  int start;//起始值
	private  int length;//显示多少条
	
	public Schclass() {
		super();
	}

	public Schclass(String id){
		super(id);
	}

	@Length(min=1, max=100, message="时段名称长度必须介于 1 和 100 之间")
	@NotNull(message="时段名称不能为空")
	public String getSchname() {
		return schname;
	}

	public void setSchname(String schname) {
		this.schname = schname;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@NotNull(message="上班时间不能为空")
	public Date getStarttime() {
		return starttime;
	}

	public void setStarttime(Date starttime) {
		this.starttime = starttime;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@NotNull(message="下班时间不能为空")
	public Date getEndtime() {
		return endtime;
	}

	public void setEndtime(Date endtime) {
		this.endtime = endtime;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@NotNull(message="开始签到时间点不能为空")
	public Date getCheckintime1() {
		return checkintime1;
	}

	public void setCheckintime1(Date checkintime1) {
		this.checkintime1 = checkintime1;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@NotNull(message="结束签到时间点不能为空")
	public Date getCheckintime2() {
		return checkintime2;
	}

	public void setCheckintime2(Date checkintime2) {
		this.checkintime2 = checkintime2;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@NotNull(message="开始签退时间点不能为空")
	public Date getCheckouttime1() {
		return checkouttime1;
	}

	public void setCheckouttime1(Date checkouttime1) {
		this.checkouttime1 = checkouttime1;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@NotNull(message="结束签退时间点不能为空")
	public Date getCheckouttime2() {
		return checkouttime2;
	}

	public void setCheckouttime2(Date checkouttime2) {
		this.checkouttime2 = checkouttime2;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getStartresttime() {
		return startresttime;
	}

	public void setStartresttime(Date startresttime) {
		this.startresttime = startresttime;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getEndresttime() {
		return endresttime;
	}

	public void setEndresttime(Date endresttime) {
		this.endresttime = endresttime;
	}
	
	@Length(min=1, max=40, message="工作时间(分钟)长度必须介于 1 和 40 之间")
	@NotNull(message="工作时间(分钟)不能为空")
	public String getShiftworktime() {
		return shiftworktime;
	}

	public void setShiftworktime(String shiftworktime) {
		this.shiftworktime = shiftworktime;
	}
	
	@Length(min=0, max=20, message="延时是否计算加班长度必须介于 0 和 20 之间")
	public String getIsovertime() {
		return isovertime;
	}

	public void setIsovertime(String isovertime) {
		this.isovertime = isovertime;
	}
	@JsonIgnore
    @NotNull(message="归属公司不能为空")
    @ExcelField(title="归属公司", align=2, sort=20)
    public Office getCompany() {
        return company;
    }

    public void setCompany(Office company) {
        this.company = company;
    }
    
    @JsonIgnore
    @NotNull(message="归属部门不能为空")
    @ExcelField(title="归属部门", align=2, sort=25)
    public Office getOffice() {
        return office;
    }

    public void setOffice(Office office) {
        this.office = office;
    }
    
    public int getStart() {
		return start;
	}

	public void setStart(int start) {
		this.start = start;
	}

	public int getLength() {
		return length;
	}

	public void setLength(int length) {
		this.length = length;
	}

}